#include <stdio.h>

int main(int argc,char *argv[])
{
    FILE *in_fp;
    if(argc > 1)
        in_fp = fopen(argv[1], "rb");
    else
        in_fp = fopen("a.in", "rb");
    if(in_fp == NULL)
    {
        printf("Cannot open the file\n");
        return -1;
    }
    char buf[15];
    while(!feof(in_fp))
    {
        int i;
        if((i = fread(&buf, sizeof(char), sizeof(buf), in_fp)) > 0)
        {
            for(int j = 0; j < i; j++)
            {
                char hex[3] = { };
                if(j)
                    fputc(' ', stdout);
                sprintf(hex, "%02x", buf[j]);
                fputs(hex, stdout);
            }
        }
        fputc('\n', stdout);
    }
    return 0;
}
